home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / PRPictur.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.6 KB  |  100 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                PRPictur.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PRPICTUR_H
  11. #define PRPICTUR_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef SLGRDEF_H
  18. #include "SLGrDef.h"
  19. #endif
  20.  
  21. #ifndef SLPTRECT_H
  22. #include "SLPtRect.h"
  23. #endif
  24.  
  25. #ifndef PRGRREF_H
  26. #include "PRGrRef.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Declarations
  31. //========================================================================================
  32.  
  33. class FW_OResourceFile;
  34.  
  35. class FW_CReadableStream;
  36. class FW_CWritableStream;
  37.  
  38. struct FW_SGraphicContext;
  39.  
  40. //========================================================================================
  41. //    class FW_CPrivPictureRep
  42. //========================================================================================
  43.  
  44. class FW_CPrivPictureRep : public FW_CPrivGrRefObj
  45. {
  46. public:
  47.     FW_DECLARE_AUTO(FW_CPrivPictureRep)
  48.  
  49. //----------------------------------------------------------------------------------------
  50. //    Constructors/Destructors
  51. //
  52.  
  53.                         FW_CPrivPictureRep(FW_CReadableStream& stream);
  54.                         FW_CPrivPictureRep(FW_OResourceFile* resourceFile, FW_ResourceID resID);
  55.                         FW_CPrivPictureRep(FW_PlatformPict platformPict);
  56.                         FW_CPrivPictureRep(const FW_CPrivPictureRep& other);
  57.                     
  58.                         ~FW_CPrivPictureRep();
  59.  
  60.     void                Write(FW_CWritableStream& stream);
  61.     FW_Boolean            IsEqual(const FW_CPrivPictureRep& other) const;
  62.     
  63. //----------------------------------------------------------------------------------------
  64. // Bounds
  65.  
  66.     void                GetPictBounds(FW_SRect& bounds) const;
  67.     void                GetPictBoundsGC(Environment* ev, FW_SGraphicContext& gc, FW_SRect& bounds) const;
  68.  
  69. //----------------------------------------------------------------------------------------
  70. // Handle operations
  71.  
  72.     FW_PlatformPict        GetPlatformPict() const;
  73.     FW_Boolean            IsPlatformPictOrphan() const;
  74.     FW_PlatformPict        OrphanPlatformPict();
  75.     
  76.     void                SetPlatformPict(FW_PlatformPict newPict);
  77.     void                AdoptPlatformPict(FW_PlatformPict newPict);
  78.  
  79. //----------------------------------------------------------------------------------------
  80. // Macintosh specific
  81.  
  82. #ifdef FW_BUILD_MAC
  83.     void                MacLock();
  84.     void                MacUnlock();
  85. #endif 
  86.  
  87. private:
  88.     void                PrivReadFrom(FW_CReadableStream& stream);
  89.     void                PrivDisposePict();
  90.  
  91.     FW_Boolean            fOwnPicture;
  92.     FW_PlatformPict     fPlatformPict;
  93.  
  94. #ifdef FW_BUILD_MAC
  95.     short                fMacLockCount;
  96. #endif
  97. };
  98.  
  99. #endif // PRPICTUR_H
  100.